#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,i,k,x,y;
    queue<int> man,woman;
    cin>>m>>n>>k;
    for(i=1;i<=m;i++)
    {
        man.push(i); //生成男士初始队列
    }
    for(i=1;i<=n;i++)
    {
        woman.push(i); //生成女士初始队列
    }
    for(i=1;i<=k;i++)
    {
        x=man.front();
        y=woman.front();
        cout<<x<<" "<<y<<endl;
        man.pop();
        woman.pop();
        man.push(x);
        woman.push(y);
    }
    return 0;
}
